using HoWave.Common;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using System.Web;
using System.Web.Script.Services;
using System.Web.Services;
[ScriptService, WebService(Namespace = "http://tempuri.org/"), WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class ShopWebService : System.Web.Services.WebService
{
	private Conn conn = new Conn();
	[WebMethod]
	public string HelloWorld()
	{
		return "Hello World";
	}
	[WebMethod]
	public List<ShopSlider> GetShopSliderData(int ShopID)
	{
		List<ShopSlider> list = new List<ShopSlider>();
		int num = 0;
		DataTable dataTable = this.conn.GetDataTable("select * from HLMall_StoreModule where ModuleID=4 and ShopID=" + ShopID);
		if (dataTable != null && dataTable.Rows.Count > 0)
		{
			DataRow dataRow = dataTable.Rows[0];
			if (dataRow["SliderPath1"] != null)
			{
				num++;
			}
			if (dataRow["SliderPath2"] != null)
			{
				num++;
			}
			if (dataRow["SliderPath3"] != null)
			{
				num++;
			}
			if (dataRow["SliderPath4"] != null)
			{
				num++;
			}
			if (dataRow["SliderPath5"] != null)
			{
				num++;
			}
			list.Add(new ShopSlider
			{
				herfNum = num,
				SliderPath1 = dataRow["SliderPath1"].ToString(),
				SliderPath2 = dataRow["SliderPath2"].ToString(),
				SliderPath3 = dataRow["SliderPath3"].ToString(),
				SliderPath4 = dataRow["SliderPath4"].ToString(),
				SliderPath5 = dataRow["SliderPath5"].ToString(),
				Sliderherf1 = dataRow["Sliderherf1"].ToString(),
				Sliderherf2 = dataRow["Sliderherf2"].ToString(),
				Sliderherf3 = dataRow["Sliderherf3"].ToString(),
				Sliderherf4 = dataRow["Sliderherf4"].ToString(),
				Sliderherf5 = dataRow["Sliderherf5"].ToString(),
				SliderElement = int.Parse(dataRow["SliderElement"].ToString())
			});
		}
		dataTable.Dispose();
		return list;
	}
	[WebMethod]
	public int intStatus(int ThreadID, string getSetStatus)
	{
		string sql = "";
		int num = 0;
		switch (getSetStatus)
		{
		case "setGoes":
			sql = "update HLMall_Thread set Setsgoes=1 where ThreadID=" + ThreadID;
			break;
		case "NotsetGoes":
			sql = "update HLMall_Thread set Setsgoes=0 where ThreadID=" + ThreadID;
			break;
		case "setEssence":
			sql = "update HLMall_Thread set EssenceArea=1 where ThreadID=" + ThreadID;
			break;
		case "NotsetEssence":
			sql = "update HLMall_Thread set EssenceArea=0 where ThreadID=" + ThreadID;
			break;
		case "setLock":
			sql = "update HLMall_Thread set Locking=1 where ThreadID=" + ThreadID;
			break;
		case "NotsetLock":
			sql = "update HLMall_Thread set Locking=0 where ThreadID=" + ThreadID;
			break;
		case "setDel":
			sql = "delete HLMall_Thread where ThreadID=" + ThreadID;
			break;
		}
		try
		{
			num = this.conn.Execute(sql);
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			num = 0;
		}
		if (getSetStatus == "setDel" && num > 0)
		{
			this.conn.Execute("delete HLMall_Threadreply where ThreadID=" + ThreadID);
		}
		return num;
	}
	[WebMethod]
	public void setThreadType(int OrderByID, int ShowPostsNum)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "6"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",6");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "6");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "6");
		}
		SetGetCookies.Set("JlOrderByID", OrderByID.ToString());
		SetGetCookies.Set("JlShowPostsNum", ShowPostsNum.ToString());
	}
	[WebMethod]
	public void setShopSlider(string ModuleTitle, string picAddress, string UrlAddress, int picElement, int picCut)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "4"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",4");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "4");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "4");
		}
		SetGetCookies.Set("picModuleName", ModuleTitle);
		SetGetCookies.Set("picAddress", picAddress);
		SetGetCookies.Set("picUrlAddress", UrlAddress);
		SetGetCookies.Set("picElement", picElement.ToString());
		SetGetCookies.Set("picCut", picCut.ToString());
	}
	[WebMethod]
	public void setShopKey(string StrKeys)
	{
		if (StrKeys != null && StrKeys != "")
		{
			SetGetCookies.Set("Keyword", StrKeys);
		}
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "3"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",3");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "3");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "3");
		}
	}
	[WebMethod]
	public void setProductRanking(string ModuleName, int SelectClassID, int ShowProductNum, decimal Pricerange1, decimal Pricerange2, string ShowType)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "1"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",1");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "1");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "1");
		}
		SetGetCookies.Set("RankModuleName", ModuleName);
		SetGetCookies.Set("RankClassID", SelectClassID.ToString());
		SetGetCookies.Set("RankShowNum", ShowProductNum.ToString());
		SetGetCookies.Set("RankPrice1", Pricerange1.ToString());
		SetGetCookies.Set("RankPrice2", Pricerange2.ToString());
		SetGetCookies.Set("RankShowType", ShowType);
	}
	[WebMethod]
	public void setEliteProduct(int PicSize, int ProductNum, string StrOrderBy)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "5"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",5");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "5");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "5");
		}
		SetGetCookies.Set("ElitePicSize", PicSize.ToString());
		SetGetCookies.Set("EliteProNum", ProductNum.ToString());
		SetGetCookies.Set("EliteOrderBy", StrOrderBy);
	}
	[WebMethod]
	public void setShopProductList(string ModuleName, string PLKeyword, int SelectClassID, int ProductType, decimal RangePrice1, decimal RangePrice2, int picSize, int itemNum, string orderType)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "7"))
				{
					SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",7");
				}
			}
			else
			{
				SetGetCookies.Set("ModuleID", "7");
			}
		}
		else
		{
			SetGetCookies.Set("ModuleID", "7");
		}
		SetGetCookies.Set("PLModuleName", ModuleName);
		SetGetCookies.Set("PLKeyword", PLKeyword);
		SetGetCookies.Set("PLSelectClassID", SelectClassID.ToString());
		SetGetCookies.Set("PLProductType", ProductType.ToString());
		SetGetCookies.Set("PLPrice1", RangePrice1.ToString());
		SetGetCookies.Set("PLPrice2", RangePrice2.ToString());
		SetGetCookies.Set("PLpicSize", picSize.ToString());
		SetGetCookies.Set("PLitemNum", itemNum.ToString());
		SetGetCookies.Set("PLorderType", orderType);
	}
	[WebMethod]
	public void setCustomizeComment(string ModuleName, string CustomizeComment, int JustID)
	{
		if (SetGetCookies.Get("ModuleID") != null)
		{
			if (SetGetCookies.Get("ModuleID").Value != "")
			{
				switch (JustID)
				{
				case 1:
					if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "8"))
					{
						SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",8");
					}
					SetGetCookies.Set("TopCusName", ModuleName);
					SetGetCookies.Set("TopCusComment", CustomizeComment);
					break;
				case 2:
					if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "9"))
					{
						SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",9");
					}
					SetGetCookies.Set("LeftCusName", ModuleName);
					SetGetCookies.Set("LeftCusComment", CustomizeComment);
					break;
				case 3:
					if (!this.ExisteModuleID(SetGetCookies.Get("ModuleID").Value, "10"))
					{
						SetGetCookies.Set("ModuleID", SetGetCookies.Get("ModuleID").Value + ",10");
					}
					SetGetCookies.Set("RightCusName", ModuleName);
					SetGetCookies.Set("RightCusComment", CustomizeComment);
					break;
				}
			}
			else
			{
				switch (JustID)
				{
				case 1:
					SetGetCookies.Set("ModuleID", "8");
					SetGetCookies.Set("TopCusName", ModuleName);
					SetGetCookies.Set("TopCusComment", CustomizeComment);
					break;
				case 2:
					SetGetCookies.Set("ModuleID", "9");
					SetGetCookies.Set("LeftCusName", ModuleName);
					SetGetCookies.Set("LeftCusComment", CustomizeComment);
					break;
				case 3:
					SetGetCookies.Set("ModuleID", "10");
					SetGetCookies.Set("RightCusName", ModuleName);
					SetGetCookies.Set("RightCusComment", CustomizeComment);
					break;
				}
			}
		}
		else
		{
			switch (JustID)
			{
			case 1:
				SetGetCookies.Set("ModuleID", "8");
				SetGetCookies.Set("TopCusName", ModuleName);
				SetGetCookies.Set("TopCusComment", CustomizeComment);
				break;
			case 2:
				SetGetCookies.Set("ModuleID", "9");
				SetGetCookies.Set("LeftCusName", ModuleName);
				SetGetCookies.Set("LeftCusComment", CustomizeComment);
				break;
			case 3:
				SetGetCookies.Set("ModuleID", "10");
				SetGetCookies.Set("RightCusName", ModuleName);
				SetGetCookies.Set("RightCusComment", CustomizeComment);
				break;
			}
		}
	}
	[WebMethod]
	public int ConfirmIssue(int ShopID, int cssID)
	{
		int num = 0;
		int num2 = 0;
		StringBuilder stringBuilder = new StringBuilder();
		string[] array;
		if (SetGetCookies.Get("ModuleID") != null)
		{
			array = SetGetCookies.Get("ModuleID").Value.Split(new char[]
			{
				','
			});
		}
		else
		{
			array = new string[0];
		}
		if (array.Length > 0)
		{
			for (int i = 0; i < array.Length; i++)
			{
				stringBuilder.Remove(0, stringBuilder.Length);
				string text = array[i];
				switch (text)
				{
				case "1":
				{
					string text2 = "";
					if (SetGetCookies.Get("RankModuleName") != null)
					{
						text2 = HttpUtility.UrlDecode(SetGetCookies.Get("RankModuleName").Value);
					}
					int num4 = -1;
					if (SetGetCookies.Get("RankClassID") != null)
					{
						try
						{
							num4 = int.Parse(SetGetCookies.Get("RankClassID").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num4 = -1;
						}
					}
					int num5 = 10;
					if (SetGetCookies.Get("RankShowNum") != null)
					{
						try
						{
							num5 = int.Parse(SetGetCookies.Get("RankShowNum").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num5 = 10;
						}
					}
					decimal num6 = 0m;
					decimal num7 = 0m;
					if (SetGetCookies.Get("RankPrice1") != null)
					{
						try
						{
							num6 = decimal.Parse(SetGetCookies.Get("RankPrice1").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num6 = 0m;
						}
					}
					if (SetGetCookies.Get("RankPrice2") != null)
					{
						try
						{
							num7 = decimal.Parse(SetGetCookies.Get("RankPrice2").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num7 = 0m;
						}
					}
					string text3 = "本月热销排行";
					if (SetGetCookies.Get("RankShowType") != null)
					{
						text3 = SetGetCookies.Get("RankShowType").Value;
					}
					stringBuilder.Append(string.Concat(new object[]
					{
						"Update HLMall_StoreModule set ModuleName='",
						text2,
						"',ClassID=",
						num4,
						","
					}));
					stringBuilder.Append(string.Concat(new object[]
					{
						"ShowProductNum=",
						num5,
						",Pricerange1=",
						num6,
						",Pricerange2=",
						num7,
						","
					}));
					stringBuilder.Append(string.Concat(new object[]
					{
						"ShowType='",
						text3,
						"' where ModuleID=1 and ShopID=",
						ShopID
					}));
					try
					{
						num = this.conn.Execute(stringBuilder.ToString());
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "3":
				{
					string text4 = "";
					if (SetGetCookies.Get("Keyword") != null)
					{
						text4 = HttpUtility.UrlDecode(SetGetCookies.Get("Keyword").Value);
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set Keyword='",
							text4,
							"' where ModuleID=3 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "4":
				{
					string text5 = "图片轮廓";
					if (SetGetCookies.Get("picModuleName") != null)
					{
						text5 = SetGetCookies.Get("picModuleName").Value;
					}
					string text6 = "";
					if (SetGetCookies.Get("picAddress") != null)
					{
						text6 = SetGetCookies.Get("picAddress").Value;
					}
					string text7 = "";
					if (SetGetCookies.Get("picUrlAddress") != null)
					{
						text7 = SetGetCookies.Get("picUrlAddress").Value;
					}
					int num8 = 120;
					if (SetGetCookies.Get("picElement") != null)
					{
						try
						{
							num8 = int.Parse(SetGetCookies.Get("picElement").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num8 = 120;
						}
					}
					int num9 = 1;
					if (SetGetCookies.Get("picCut") != null)
					{
						try
						{
							num9 = int.Parse(SetGetCookies.Get("picCut").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num9 = 1;
						}
					}
					stringBuilder.Append(string.Concat(new string[]
					{
						"Update HLMall_StoreModule set ModuleName='",
						text5,
						"',SliderPath='",
						text6,
						"',"
					}));
					stringBuilder.Append(string.Concat(new object[]
					{
						"Sliderherf='",
						text7,
						"',SliderElement=",
						num8,
						",SliderCutType=",
						num9,
						" where ModuleID=4 and ShopID=",
						ShopID
					}));
					try
					{
						num = this.conn.Execute(stringBuilder.ToString());
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "5":
				{
					int num10 = 120;
					int num11 = 6;
					string text8 = "NewOn";
					if (SetGetCookies.Get("ElitePicSize") != null)
					{
						try
						{
							num10 = int.Parse(SetGetCookies.Get("ElitePicSize").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num10 = 120;
						}
					}
					if (SetGetCookies.Get("EliteProNum") != null)
					{
						try
						{
							num11 = int.Parse(SetGetCookies.Get("EliteProNum").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num11 = 6;
						}
					}
					if (SetGetCookies.Get("EliteOrderBy") != null)
					{
						text8 = SetGetCookies.Get("EliteOrderBy").Value;
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set Picturesize=",
							num10,
							",ShowProductNum=",
							num11,
							",Sortingway='",
							text8,
							"' where ModuleID=5 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "6":
				{
					int num12 = 1;
					if (SetGetCookies.Get("JlOrderByID") != null)
					{
						try
						{
							num12 = int.Parse(SetGetCookies.Get("JlOrderByID").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num12 = 1;
						}
					}
					int num13 = 10;
					if (SetGetCookies.Get("JlShowPostsNum") != null)
					{
						try
						{
							num13 = int.Parse(SetGetCookies.Get("JlShowPostsNum").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num13 = 10;
						}
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set PostsShowType=",
							num12,
							",ShowPostsNum=",
							num13,
							" where ModuleID=6 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "7":
				{
					string text9 = "商品列表";
					if (SetGetCookies.Get("PLModuleName") != null)
					{
						text9 = HttpUtility.UrlDecode(SetGetCookies.Get("PLModuleName").Value);
					}
					string text10 = "";
					if (SetGetCookies.Get("PLKeyword") != null)
					{
						text10 = SetGetCookies.Get("PLKeyword").Value;
					}
					int num14 = -1;
					if (SetGetCookies.Get("PLSelectClassID") != null)
					{
						try
						{
							num14 = int.Parse(SetGetCookies.Get("PLSelectClassID").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num14 = -1;
						}
					}
					int num15 = -1;
					if (SetGetCookies.Get("PLProductType") != null)
					{
						try
						{
							num15 = int.Parse(SetGetCookies.Get("PLProductType").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num15 = -1;
						}
					}
					decimal num16 = 0m;
					decimal num17 = 0m;
					if (SetGetCookies.Get("PLPrice1") != null)
					{
						try
						{
							num16 = decimal.Parse(SetGetCookies.Get("PLPrice1").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num16 = 0m;
						}
					}
					if (SetGetCookies.Get("PLPrice2") != null)
					{
						try
						{
							num17 = decimal.Parse(SetGetCookies.Get("PLPrice2").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num17 = 0m;
						}
					}
					int num18 = 120;
					if (SetGetCookies.Get("PLpicSize") != null)
					{
						try
						{
							num18 = int.Parse(SetGetCookies.Get("PLpicSize").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num18 = 120;
						}
					}
					int num19 = 10;
					if (SetGetCookies.Get("PLitemNum") != null)
					{
						try
						{
							num19 = int.Parse(SetGetCookies.Get("PLitemNum").Value);
						}
						catch (Exception ex)
						{
							ex.WriteErrorLog(new string[0]);
							num19 = 10;
						}
					}
					string text11 = "Humanspirit";
					if (SetGetCookies.Get("PLorderType") != null)
					{
						text11 = SetGetCookies.Get("PLorderType").Value;
					}
					stringBuilder.Append(string.Concat(new string[]
					{
						"Update HLMall_StoreModule set ModuleName='",
						text9,
						"',Keyword='",
						text10,
						"',"
					}));
					stringBuilder.Append(string.Concat(new object[]
					{
						"ClassID=",
						num14,
						",ProductType=",
						num15,
						",Pricerange1=",
						num16,
						","
					}));
					stringBuilder.Append(string.Concat(new object[]
					{
						"Pricerange2=",
						num17,
						",Picturesize=",
						num18,
						",ShowProductNum=",
						num19,
						",Sortingway='",
						text11,
						"' where ModuleID=7 and ShopID=",
						ShopID
					}));
					try
					{
						num = this.conn.Execute(stringBuilder.ToString());
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "8":
				{
					string text12 = "";
					if (SetGetCookies.Get("TopCusName") != null)
					{
						text12 = HttpUtility.UrlDecode(SetGetCookies.Get("TopCusName").Value);
					}
					string text13 = "";
					if (SetGetCookies.Get("TopCusComment") != null)
					{
						text13 = HttpUtility.UrlDecode(SetGetCookies.Get("TopCusComment").Value);
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set ModuleName='",
							text12,
							"',CustomizeComment='",
							text13,
							"' where ModuleID=8 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "9":
				{
					string text14 = "";
					if (SetGetCookies.Get("LeftCusName") != null)
					{
						text14 = HttpUtility.UrlDecode(SetGetCookies.Get("LeftCusName").Value);
					}
					string text15 = "";
					if (SetGetCookies.Get("LeftCusComment") != null)
					{
						text15 = HttpUtility.UrlDecode(SetGetCookies.Get("LeftCusComment").Value);
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set ModuleName='",
							text14,
							"',CustomizeComment='",
							text15,
							"' where ModuleID=9 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				case "10":
				{
					string text16 = "";
					if (SetGetCookies.Get("RightCusName") != null)
					{
						text16 = HttpUtility.UrlDecode(SetGetCookies.Get("RightCusName").Value);
					}
					string text17 = "";
					if (SetGetCookies.Get("RightCusComment") != null)
					{
						text17 = HttpUtility.UrlDecode(SetGetCookies.Get("RightCusComment").Value);
					}
					try
					{
						num = this.conn.Execute(string.Concat(new object[]
						{
							"Update HLMall_StoreModule set ModuleName='",
							text16,
							"',CustomizeComment='",
							text17,
							"' where ModuleID=10 and ShopID=",
							ShopID
						}));
					}
					catch (Exception ex)
					{
						ex.WriteErrorLog(new string[0]);
						num = 0;
					}
					break;
				}
				}
			}
		}
		if (cssID > 0)
		{
			try
			{
				num2 = this.conn.Execute(string.Concat(new object[]
				{
					"Update HLShop_Shop set CSSID=",
					cssID,
					" where ShopID=",
					ShopID
				}));
			}
			catch (Exception ex)
			{
				ex.WriteErrorLog(new string[0]);
				num2 = 0;
			}
		}
		num += num2;
		return num;
	}
	[WebMethod]
	public int IssueNewThread(int ShopID, int UserID, string UserName, string posttitle, string postcontent)
	{
		int num = 1;
		int num2 = 0;
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.Append("insert into HLMall_Thread(threadTitle,ShopID,WriterID,Writer,CreateTime,Setsgoes,EssenceArea,Locking,UpdateTime,EndReplyDate,threadContent)");
		stringBuilder.Append(string.Concat(new object[]
		{
			" values('",
			posttitle,
			"',",
			ShopID,
			",",
			UserID,
			",'",
			UserName,
			"','",
			DateTime.Now.ToString(),
			"',"
		}));
		stringBuilder.Append(string.Concat(new string[]
		{
			" 0,0,0,'",
			DateTime.Now.ToString(),
			"','",
			DateTime.Now.ToString(),
			"','",
			postcontent,
			"')"
		}));
		try
		{
			num = this.conn.Execute(stringBuilder.ToString());
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			num = 0;
		}
		if (num == 1)
		{
			DataTable dataTable = this.conn.GetDataTable("select Max(ThreadID) as maxID from HLMall_Thread");
			if (dataTable != null && dataTable.Rows.Count > 0)
			{
				num2 = int.Parse(dataTable.Rows[0]["maxID"].ToString());
			}
			dataTable.Dispose();
			if (this.conn.ExecuteCount(string.Concat(new object[]
			{
				"select count(*) from HLShop_Shop as a,HLMall_Thread as b where a.ShopID=b.ShopID and a.ShopID=",
				ShopID,
				" and a.ShopOwnerID=",
				UserID
			})) > 0)
			{
				this.conn.Execute(string.Concat(new object[]
				{
					"insert into HLMall_Threadreply(threadID,replyWriter,AutoReply) values(",
					num2,
					",'",
					UserName,
					"',-1)"
				}));
			}
		}
		return num2;
	}
	[WebMethod]
	public int EditThreadContent(int threadID, string ThreadContent)
	{
		int result = 0;
		try
		{
			result = this.conn.Execute(string.Concat(new object[]
			{
				"Update HLMall_Thread set threadContent='",
				ThreadContent,
				"',UpdateTime='",
				DateTime.Now.ToString(),
				"' where ThreadID=",
				threadID
			}));
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			result = 0;
		}
		return result;
	}
	[WebMethod]
	public int ReplyThread(int threadID, string replyWriter, int IsOwner, string replyContent)
	{
		int num = 0;
		StringBuilder stringBuilder = new StringBuilder();
		stringBuilder.Append("insert into HLMall_Threadreply(threadID,replyWriter,IsOwner,replyContent,CreateTime,AutoReply)");
		stringBuilder.Append(string.Concat(new object[]
		{
			" values (",
			threadID,
			",'",
			replyWriter,
			"',",
			IsOwner,
			",'",
			replyContent,
			"','",
			DateTime.Now.ToString(),
			"',1)"
		}));
		string sql = string.Concat(new object[]
		{
			"Update HLMall_Thread set EndReplyDate='",
			DateTime.Now.ToString(),
			"' where threadID=",
			threadID
		});
		try
		{
			num = this.conn.Execute(stringBuilder.ToString());
			if (num > 0)
			{
				num = this.conn.Execute(sql);
			}
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			num = 0;
		}
		return num;
	}
	[WebMethod]
	public int DelThread(string strThreadID)
	{
		int result = 0;
		strThreadID = strThreadID.Substring(0, strThreadID.Length - 1);
		try
		{
			result = this.conn.Execute("delete HLMall_Thread where ThreadID in (" + strThreadID + ")");
		}
		catch (Exception ex)
		{
			ex.WriteErrorLog(new string[0]);
			result = 0;
		}
		return result;
	}
	public bool ExisteModuleID(string strModuleID, string ModuleID)
	{
		bool result = false;
		if (strModuleID != "")
		{
			string[] array = strModuleID.Split(new char[]
			{
				','
			});
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i] == ModuleID)
				{
					result = true;
					break;
				}
			}
		}
		return result;
	}
}
